package com.douqu.game.core.entity.ext.data.boon;

import com.bean.core.buffer.ByteBuffer;
import com.douqu.game.core.entity.EntityObject;

/**
 * @author: miracle.
 * Description:
 * Date: 2018/5/23 0023 下午 7:49
 * Huan Yu Copyright (c) 2017 All Rights Reserved.
 */
public class ShareBean extends EntityObject{

    private int shareId;

    private int stateCode;

    public ShareBean(){};

    public ShareBean(int shareId,int stateCode){
        this.shareId = shareId;
        this.stateCode = stateCode;
    }

    public ShareBean(int shareId,ByteBuffer byteBuffer){
        loadFrom(shareId,byteBuffer);
    }

    public void loadFrom(int shareId,ByteBuffer byteBuffer){
        this.shareId = shareId;
        this.stateCode = byteBuffer.readByte();
    }

    public void writeTo(ByteBuffer buffer){
        buffer.writeByte(stateCode);
    }

    public int getShareId() {
        return shareId;
    }

    public void setShareId(int shareId) {
        this.shareId = shareId;
    }

    public int getStateCode() {
        return stateCode;
    }

    public void setStateCode(int stateCode) {
        this.stateCode = stateCode;
    }

    @Override
    public String toString() {
        return "ShareBean{" +
                "shareId=" + shareId +
                ", stateCode=" + stateCode +
                '}';
    }
}
